Vice City Multiplayer

VC:MP => mIRC/pawn Scripting => Topic started by: heton99 on February 22, 2010, 09:27:43 AM

Title: I need 2 scripts :)
Post by: heton99 on February 22, 2010, 09: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)


Title: Re: I need 2 scripts :)
Post by: Ettans on February 22, 2010, 09:57:41 AM
mIRC or PAWN server?
Title: Re: I need 2 scripts :)
Post by: heton99 on February 22, 2010, 10:00:12 AM
pawn
Title: Re: I need 2 scripts :)
Post by: Ettans on February 22, 2010, 10:06:46 AM
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.
Title: Re: I need 2 scripts :)
Post by: heton99 on February 22, 2010, 10:12:52 AM
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
Title: Re: I need 2 scripts :)
Post by: Ettans on February 22, 2010, 10:16:04 AM
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?
Title: Re: I need 2 scripts :)
Post by: heton99 on February 22, 2010, 10:18:12 AM
I do not understand you me english very bad :X
Title: Re: I need 2 scripts :)
Post by: Ettans on February 22, 2010, 10:21:04 AM
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;
}
Title: Re: I need 2 scripts :)
Post by: heton99 on February 22, 2010, 10:21:55 AM
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);
Title: Re: I need 2 scripts :)
Post by: Ettans on February 22, 2010, 10:25:20 AM
Not sure what's wrong with it, as the line is ok.
Title: Re: I need 2 scripts :)
Post by: heton99 on February 22, 2010, 10:47:54 AM
:( ok.. who can make 2 script? race
Title: Re: I need 2 scripts :)
Post by: Boss on February 22, 2010, 11:17:11 AM
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.