Vice City Multiplayer
VC:MP 0.3 => mIRC/pawn Scripting => Topic started by: heton99 on February 22, 2010, 11:27:43 am
-
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)
-
mIRC or PAWN server?
-
pawn
-
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.
-
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
-
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?
-
I do not understand you me english very bad :X
-
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;
}
-
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);
-
Not sure what's wrong with it, as the line is ok.
-
:( ok.. who can make 2 script? race
-
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.