• Welcome to Vice City Multiplayer.
 

I need 2 scripts :)

Started by heton99, February 22, 2010, 09:27:43 AM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

heton99

Hello. I need 2 scripts:
for spawn vehicle and race

first script  spawn pcj600 :)

two script:
I say !race
scripts says:
5
4
3
2
1
Go Go Go!

(sry for me english is very bad :P)



Ettans


heton99


Ettans

Put this under OnPlayerText callback:


if(strcmp(text,"!pcj",true) == 0)
{
    new Float:x,
          Float:y,
          Float:z,
          Float:angle,
          string[64],
          pveh[MAX_PLAYERS] = 0;

    GetPlayerPos(playerid,x,y,z);
    GetPlayerFacingAngle(playerid,angle);

    pveh[playerid] = CreateVehicle(191,x,y,z,angle,-1,-1);
    PutPlayerInVehicle(playerid,pveh[playerid]);
    SendClientMessage(playerid,0xFFFFFFFF,"Spawned a PCJ-600!");
    return 0;
}


In-game type !pcj.

heton99

i have error compile:

D:\Gta Vice City\gamemodes\stunt.pwn(226) : error 017: undefined symbol "text"
D:\Gta Vice City\gamemodes\stunt.pwn(228) : warning 219: local variable "x" shadows a variable at a preceding level
D:\Gta Vice City\gamemodes\stunt.pwn(229) : warning 219: local variable "y" shadows a variable at a preceding level
D:\Gta Vice City\gamemodes\stunt.pwn(230) : warning 219: local variable "z" shadows a variable at a preceding level
D:\Gta Vice City\gamemodes\stunt.pwn(238) : warning 202: number of arguments does not match definition
D:\Gta Vice City\gamemodes\stunt.pwn(242) : warning 204: symbol is assigned a value that is never used: "string"

Pawn compiler 3.0.3367         Copyright (c) 1997-2005, ITB CompuPhase

Ettans

Do you have x,y and z defined globally? Just rename the text to cmdtext and you can remove the string[64]. Also, what line exactly gives the "warning 202: number of arguments does not match definition" warning?

heton99

I do not understand you me english very bad :X

Ettans

Ok, try this:


if(strcmp(cmdtext,"!pcj",true) == 0)
{
    new Float:angle;

    GetPlayerPos(playerid,x,y,z);
    GetPlayerFacingAngle(playerid,angle);

    CreateVehicle(191,x,y,z,angle,-1,-1);
    SendClientMessage(playerid,0xFFFFFFFF,"Spawned a PCJ-600!");
    return 0;
}

heton99

error:

D:\Gta Vice City\gamemodes\stunt.pwn(325) : warning 202: number of arguments does not match definition
Pawn compiler 3.0.3367 Copyright (c) 1997-2005, ITB CompuPhase


1 Warning.


LINE 325
CreateVehicle(191,x,y,z,angle,-1,-1);

Ettans

Not sure what's wrong with it, as the line is ok.

heton99

#10
:( ok.. who can make 2 script? race

Boss

#11
Please refer to the following resources to learn Pawn scripting:
http://www.compuphase.com/pawn/pawn.htm#DOWNLOAD_DOCS
http://wiki.sa-mp.com/wiki/Category:Scripting_Documentation
http://tdhclan.ru/wiki/index.php/Scripting

If these don't help and you still can't script in Pawn, please hire a scripter to make scripts for you or post a mode request thread instead of requesting each function separately.